package com.wdb007.venus.svc.biz.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.wdb007.venus.svc.facade.ConfigService;

@Component
public class ConfigInfoManager {

	@Autowired
	private ConfigService configService;
	
	public String getValue(String key){
		return configService.getValue(key);
	}
	
	public  String getImgUrlPrefix(){
		return getValue("imgurl_prefix");
	}
	
	public  String getImgUrlSuffix(){
		return getValue("imgurl_suffix");
	}
	public  String getUserHeadSuffix2(){
		return getValue("user_head_suffix");
	}
	/**
	 * 获取图片完整链接，包括后缀
	 * @param middleUrl
	 * @return
	 */
	public  String getImgurl(String middleUrl){
		return getImgUrlPrefix() + middleUrl + getImgUrlSuffix();
	}
	/**
	 * 获取头像完整链接，包括后缀
	 * @param middleUrl
	 * @return
	 */
	public  String getImgurl2(String middleUrl){
		return getImgUrlPrefix() + middleUrl + getUserHeadSuffix2();
	}
	/**
	 * 完整图片链接，不包括后缀
	 * @param middleUrl
	 * @return
	 */
	public String getImgurl3(String middleUrl) {
		return getImgUrlPrefix() + middleUrl;
	}
	public  String getBookDefaultImg(){
		return getImgurl(getValue("book_img_default"));
	}
	public void main(String[] args) throws Exception {
		System.out.println(getValue("jdbc.url"));
	}
}
